<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'editClient_main.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" href="css/menu_tab.css">
		<link rel="stylesheet" type="text/css" href="css/list_1.css">
		<link rel="stylesheet" type="text/css" href="css/left_tabmenu.css">
		<link rel="stylesheet" type="text/css" href="css/public.css">
		<script type="text/javascript" src="js/showmenu.js"></script>
		<style type="text/css">
#balancesheet {
	padding-top: 1;
	margin-left: 50px;
	font-size: 12;
}

#asset td {
	height: 25;
}

#debt td {
	height: 25;
}

#report_input {
	BORDER-RIGHT: gray 1px solid;
	BORDER-TOP: gray 1px solid;
	BORDER-LEFT: gray 1px solid;
	BORDER-BOTTOM: gray 1px solid;
}
</style>
	</head>


<script type="text/javascript"> 

var isIe = (document.all) ? true : false;
function init(){
    document.onkeydown = function(evt){
        catchKeyDown(evt);
    }
}
function catchKeyDown(evt){
    evt = (evt) ? evt : ((window.event) ? window.event : "");
    var key = isIe ? evt.keyCode : evt.which;
    if (evt.keyCode == 13) {
    	var reg = new RegExp("^[-]?[0-9]*[,]*[0-9]*(.[0-9]{1,3})?$");
    	if(!reg.test(evt.target.value) || evt.target.value == '-'){
			alert("数值格式不准确，请重新输入！");
			evt.target.value = '';
			return;
    	}
        var el = evt.srcElement || evt.target;
        if (el.tagName.toLowerCase() == "input" && el.type != "submit") {
           if (isIe) {
              evt.keyCode = 9;
           } else {
              nextCtl(el).focus();
              evt.preventDefault();
           }
       }
    }
}
function nextCtl(ctl) {
var form = ctl.form;
for (var i = 0; i < form.elements.length - 1; i++) {
   if (ctl == form.elements[i]) {
    return form.elements[i + 1];
   }
}
return ctl;
}
window.onload = init;

</script>

	<script>
	function submitForm(url) {
		var theform = document.form1;
		theform.action = url;
		theform.method = "post";
		theform.submit();
	}
</script>

	<body>
		<table width="100%">
			<tr>
				<td>
					<table width="100%">
						<tr>
							<td><jsp:include page="../top.jsp" flush="true"></jsp:include></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td height="4"></td>
			</tr>
			<tr>
				<td
					style="padding-left: 4px; padding-right: 4px; height: 20px; text-align: left;">
					<div class="text_note" style="background: #BCD2EE; height: 18px;">
						&nbsp;&nbsp;当前位置：
						<a href="#" style="text-decoration: none;">首页</a>&gt;&gt;客户管理&gt;&gt;财务报表
					</div>
				</td>
			</tr>
			<tr>
				<td height="2"></td>
				<td></td>
			</tr>

			<tr>
				<td width="85%" style="text-align: left;">
					<img src="images/arrow.gif" />
					当前客户--客户号：${custInfo.custNo} &nbsp;&nbsp;&nbsp;客户名称：${custName}
					&nbsp;&nbsp;&nbsp;客户类型：${custType}
					<br>
					<br />
					<hr>
				</td>
			</tr>
			<tr>
				<td>
					<table>
						<td td width="85%" style="text-align: left; padding-left: 120px;">
							<img src="images/arrow.gif" />
							当前财报--会计月份：${report.id.accountMonth}
							&nbsp;&nbsp;&nbsp;报表口径：${DataDictionary['ReportScope'][report.id.reportScope].itemName}
							&nbsp;&nbsp;&nbsp;报表类型：${DataDictionary['ReportKind'][report.reportKind].itemName}
							&nbsp;&nbsp;&nbsp;报表币种：${DataDictionary['Currency'][report.reportCurrency].itemName}
						</td>
						</td>
						<td style="text-align: right; padding-right: 150px;">
							<input type="button" class="button" value="返回财报列表"
								onClick="window.location.href = 'view/customer/Customer_ReportList.jsp'";
>
						</td>
					</table>
				</td>
			</tr>

			<tr>
				<td height="2"></td>
			</tr>
			<tr>
				<td style="vertical-align: top; margin: auto">
					<table width="80%" style="margin: auto; border: solid 1px;">
						<tr>
							<td>
								<div id="tabs">
									<ul>
										<!-- CSS Tabs -->
										<li id="current">
											<a href="customer/saveFinanBalance.do"><span>资产负债表</span>
											</a>
										</li>
										<li>
											<a href="customer/saveFinanIncome.do"><span>损益表</span>
											</a>
										</li>
										<li ><a href="customer/saveFinanFinancialIndexInput.do"><span>财务比率指标补充信息</span></a></li>
										<li>
											<a href="customer/formVerify.do"><span>报表校验</span>
											</a>
										</li>
									</ul>
								</div>
							</td>
						</tr>
						<tr>
							<td>
								<form name="form1">
									<div style="border: 1px #fff solid;">
									<br/>
										<table width="80%" border="0" cellspacing="1" cellpadding="2"
											id="balancesheet">
											<tr>
												<td width="50%" valign="top">
													<table width="100%" border="0" cellpadding="2"
														cellspacing="2" bgcolor="#DDDDDD" id="asset">
		<tr id="list_title">
	<th >项目</th>
	<th>金额（元）<th/>
	</tr>
														<c:choose>

															<c:when test="${flag==1}">
																<c:forEach var="a" items="${FinanAssetDataList}">
																	<c:choose>
																		<c:when
																			test="${a.displayFlag == '01' || a.displayFlag == '11'}">
																			<tr bgcolor="#EDECFF">
																				<td width="50%" id="text" style="text-align: left;font-weight: bold;">
																					${a.displayName}
																				</td>
																				<td>
																					<input type="text" name="${a.reportItemNo}"
																						value="${a.itemValueString}" id="report_input">
																				</td>
																			</tr>
																		</c:when>
																		<c:when
																			test="${a.displayFlag == '02' || a.displayFlag == '12'}">
																			<tr bgcolor="#FFFFB0">
																				<td width="50%" id="text"
																					style="text-align: right; font-weight: bold;">
																					${a.displayName}
																				</td>
																				<td>
																					<input type="text" name="${a.reportItemNo}"
																						value="${a.itemValueString}" id="report_input">
																				</td>
																			</tr>
																		</c:when>
																		<c:otherwise>
																			<tr bgcolor="#FFFFFF">
																				<td width="50%" id="text" style="text-align: left;">
																					${a.displayName}
																				</td>
																				<td>
																					<input type="text" name="${a.reportItemNo}"
																						value="${a.itemValueString}" id="report_input">
																				</td>
																			</tr>
																		</c:otherwise>
																	</c:choose>
																</c:forEach>
															</c:when>

															<c:otherwise>
																<c:forEach var="a" items="${FinanAssetList}">
																	<c:choose>
																		<c:when
																			test="${a.displayFlag == '01' || a.displayFlag == '11'}">
																			<tr bgcolor="#EDECFF">
																				<td width="50%" id="text" style="text-align: left;font-weight: bold;">
																					${a.displayName}
																				</td>
																				<td>
																					<input type="text" name="${a.financeItemNo}"
																						id="report_input">
																				</td>
																			</tr>
																		</c:when>
																		<c:when
																			test="${a.displayFlag == '02' || a.displayFlag == '12'}">
																			<tr bgcolor="#FFFFB0">
																				<td width="50%" id="text"
																					style="text-align: right; font-weight: bold;">
																					${a.displayName}
																				</td>
																				<td>
																					<input type="text" name="${a.financeItemNo}"
																						id="report_input">
																				</td>
																			</tr>
																		</c:when>
																		<c:otherwise>
																			<tr bgcolor="#FFFFFF">
																				<td width="50%" id="text" style="text-align: left;">
																					${a.displayName}
																				</td>
																				<td>
																					<input type="text" name="${a.financeItemNo}"
																						id="report_input">
																				</td>
																			</tr>
																		</c:otherwise>
																	</c:choose>
																</c:forEach>
															</c:otherwise>

														</c:choose>
													</table>

												</td>
												<td width="1%">
													&nbsp;
												</td>
												<td width="49%" valign="top">
													<table width="100%" border="0" align="center"
														cellpadding="2" cellspacing="2" bgcolor="#DDDDDD"
														id="debt">
																<tr id="list_title">
	<th >项目</th>
	<th>金额（万元）<th/>
	</tr>
														
														<c:choose>

															<c:when test="${flag==1}">
																<c:forEach var="d" items="${FinanDebtDataList}">

																	<c:choose>
																		<c:when
																			test="${d.displayFlag == '01' || d.displayFlag == '11'}">
																			<tr bgcolor="#EDECFF">
																				<td width="50%" id="text" style="text-align: left;font-weight: bold;">
																					${d.displayName}
																				</td>
																				<td>
																					<font size="2"><input type="text"
																							name="${d.reportItemNo}" value="${d.itemValueString}"
																							id="report_input">
																					</font>
																				</td>
																			</tr>
																		</c:when>
																		<c:when
																			test="${d.displayFlag == '02' || d.displayFlag == '12'}">
																			<tr bgcolor="#FFFFB0">
																				<td width="50%" id="text"
																					style="text-align: right; font-weight: bold;">
																					${d.displayName}
																				</td>
																				<td>
																					<input type="text" name="${d.reportItemNo}"
																						value="${d.itemValueString}" id="report_input">
																				</td>
																			</tr>
																		</c:when>
																		<c:otherwise>
																			<tr bgcolor="#FFFFFF">
																				<td width="50%" id="text" style="text-align: left;">
																					${d.displayName}
																				</td>
																				<td>
																					<input type="text" name="${d.reportItemNo}"
																						value="${d.itemValueString}" id="report_input">
																				</td>
																			</tr>
																		</c:otherwise>
																	</c:choose>
																</c:forEach>
															</c:when>

															<c:otherwise>
																<c:forEach var="d" items="${FinanDebtList}">
																	<c:choose>
																		<c:when
																			test="${d.displayFlag == '01' || d.displayFlag == '11'}">
																			<tr bgcolor="#EDECFF">
																				<td width="50%" id="text" style="text-align: left;font-weight: bold;">
																					${d.displayName}
																				</td>
																				<td>
																					<input type="text" name="${d.financeItemNo}"
																						id="report_input">
																				</td>
																			</tr>
																		</c:when>
																		<c:when
																			test="${d.displayFlag == '02' || d.displayFlag == '12'}">
																			<tr bgcolor="#FFFFB0">
																				<td width="50%" id="text"
																					style="text-align: right; font-weight: bold;">
																					${d.displayName}
																				</td>
																				<td>
																					<input type="text" name="${d.financeItemNo}"
																						id="report_input">
																				</td>
																			</tr>
																		</c:when>
																		<c:otherwise>
																			<tr bgcolor="#FFFFFF">
																				<td width="50%" id="text" style="text-align: left;">
																					${d.displayName}
																				</td>
																				<td>
																					<input type="text" name="${d.financeItemNo}"
																						id="report_input">
																				</td>
																			</tr>
																		</c:otherwise>
																	</c:choose>
																</c:forEach>
															</c:otherwise>
														</c:choose>
													</table>
												</td>
											</tr>
										</table>

										<br />
										<div align="center">
											<table style="margin: auto; width: 20%;">
												<tr>
													<td id="save">
														<br>
													</td>
													<td height="50">
														<input type="button" class="button"
															onClick="submitForm('customer/saveFinanBalance.do?type=0')"
															value="暂存" />
													</td>
													<td height="50">
														<input type="button" class="button"
															onClick="submitForm('customer/saveFinanBalance.do?type=1')"
															value="保存">
													</td>
													<td>
														<br>
													</td>
													<td height="50">
														<input type="reset" class="button" value="取消">
													</td>
													<td id="delete"></td>
												</tr>
											</table>
										</div>
										<br />
									</div>
								</form>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%">
						<tr>
							<td><jsp:include page="../bottom.jsp"></jsp:include></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>
